Add edit-action link to the media-integrity data-health check#1376
Merged
Conversation
The "Media / file integrity" data-health check listed artifacts whose pdf_file/raw_file/thumbnail is missing on disk, but — unlike the other checks (e.g. unlinked-artifacts) — gave no way to act on a row. Add a row_link so each missing-file row gets an "Open →" button to the artifact's admin edit page, where the editor can re-upload the file or clear the dead reference. Orphan-file rows have no DB object to open (they're handled by delete_unused_files), so they intentionally get no link. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The Media / file integrity Data Health check surfaces artifacts whose
pdf_file/raw_file/thumbnailreference points at a file missing on disk — but, unlike the other checks (e.g.unlinked-artifacts), it offered no way to act on a row.This adds a
row_linkso each missing-file row gets an "Open →" button linking to that artifact's admin edit page, where the editor can re-upload the file or clear the dead reference. Orphan-file rows (a file on disk with no DB row — handled bydelete_unused_files) have no object to open, so they intentionally get no link.Why
Came out of #840: a missing artifact file 500'd the publications listing (fixed separately in #1374). This check is the right place to find and fix those missing files on -test/prod, and an action button makes it one click instead of a manual hunt.
No new dependency or template change — the dashboard's existing
row_linkplumbing (views.py+detail.html) already renders an "Action" column when a check provides links.Tests
test_missing_file_row_links_to_admin_editinwebsite/tests/test_data_health.py— asserts the "Open →" link targets the admin change page and that orphan-file rows get no link. Fulltest_data_healthsuite green (23 tests).🤖 Generated with Claude Code